home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
626-637
/
disk_629
/
apig
/
apig31.lzh
/
e1_window.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1992-02-22
|
4KB
|
137 lines
/* This example simply opens and closes a window, writes to window console */
/* add library */
x = addlib("apig.library",0,-30,0)
portname = "example1_port" /* this is the name of the port that */
/* intuimessages will be sent to */
p = openport(portname) /* create the port */
call set_apig_globals() /* initialize INTUITION constants */
WaitForPort portname /* this port should be here by now */
scr = 0
wintitle = "This is your Window title"
winidcmp = CLOSEWINDOW /* the INTUI-Events you want the window */
/* to receive */
/* set window flags for system gadgets and type of window you want */
winflags = WINDOWCLOSE+WINDOWDRAG+WINDOWSIZING+WINDOWDEPTH+GIMMEZEROZERO
/* open window, since scr = 0 the window opens on WorkBench screen */
/* this window is opened with a console attached */
win = openwindow(portname,0,0,640,200,2,4,winidcmp,winflags,wintitle,scr,1,0,0)
wrastport = getwindowrastport(win) /* need rastport to do graphics/itext */
teststring = "A test of writing to windows console "
do i = 1 to 15
z = writeconsole(win,(i teststring || '0a'x))
end
z = writeconsole(win,'0a'x)
z = writeconsole(win,'0a'x)
z = writeconsole(win,'0a'x)
z = writeconsole(win,teststring)
wait 2 secs
do i = 1 to length(teststring)
z = writeconsole(win,'0820'x) /* this is a backspace and space */
z = writeconsole(win,'08'x)
end
do i = 1 to length(teststring)
z = writeconsole(win,substr(teststring,i,1))
end
wait 1 secs
do i = 1 to length(teststring)
z = writeconsole(win,'0820'x)
z = writeconsole(win,'08'x)
end
z = writeconsole(win,"Im gonna go delete a line")
wait 1 sec
do i = 1 to 9
z = writeconsole(win,'9b46'x) /* move up 1 line */
end
z = writeconsole(win,'9b4d'x) /* delete line */
wait 1 sec
z = writeconsole(win,'9b4c'x) /* insert line */
z = writeconsole(win,"Just wanted to insert this ")
/* ------------------------------- */
wait 1 secs
z = clearscreen(wrastport,0,0)
do i = 10 to 190 by 11
z = pitext(wrastport,10,i,"This is a test",1,2,JAM2,0)
end
wait 1 secs
z = clearscreen(wrastport,0,0)
z = clearscreen(wrastport,0,0)
z = pitext(wrastport,170,60,"Im Done ... Close the Window",1,2,JAM2,0)
say " Windows Left Edge " windowinfo(win,1)
say " Windows Top Edge " windowinfo(win,2)
say " Windows Width " windowinfo(win,3)
say " Windows Height " windowinfo(win,4)
say " Windows MouseY " windowinfo(win,5)
say " Windows MouseX " windowinfo(win,6)
say " Windows MinWidth " windowinfo(win,7)
say " Windows MinHeight " windowinfo(win,8)
say " Windows MaxWidth " windowinfo(win,9)
say " Windows MaxHeight " windowinfo(win,10)
say " Windows Flags " windowinfo(win,11)
say " Windows Requester count " windowinfo(win,12)
say " Windows Border Left " windowinfo(win,13)
say " Windows Border Top " windowinfo(win,14)
say " Windows Border Right " windowinfo(win,15)
say " Windows Border Bottom " windowinfo(win,16)
say " Windows IDCMP Flags " windowinfo(win,17)
say " Windows Detail Pen " windowinfo(win,18)
say " Windows Block Pen " windowinfo(win,19)
say " Windows GZZMouseY " windowinfo(win,20)
say " Windows GZZMouseX " windowinfo(win,21)
say " Windows GZZWidth " windowinfo(win,22)
say " Windows GZZHeight " windowinfo(win,23)
do forever
x = waitpkt(portname)
do forever
msg = getpkt(portname)
if msg = '0000 0000'x then leave
class = getarg(msg,0)
if class = CLOSEWINDOW then exitme = 1
x = reply(msg,0)
end
if exitme = 1 then leave
end
a = closewindow(win)
exit